<% if current_user %>
<h1>Leaving Feedback for the Customer</h1>

<%= form_for(@order) do |f| %>
  <% if @order.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@order.errors.count, "error") %> prohibited this order from being saved:</h2>

      <ul>
      <% @order.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.text_field :customer_feedback %>
  </div>
  <div class="actions">
    <%= f.submit "Leave Feedback" %>
  </div>
<% end %>

<%= link_to 'Home page', root_url %>
<% else %>
<p>Error: You are not currently logged in.</p>
<p>If you would like to place an order please <%= link_to "log in", log_in_path %>.<p>
<p>If you do not have an account, please <%= link_to "sign up", sign_up_path %><p>
<p>Or you can return to the <%= link_to "home page", root_url %>.<p>
<% end  %>

